<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 题目:假如投资的年利率为5%，从1000块增长到5000块需要多少年？
        var money = 1000;
        var payment = 0.05;
        var year = 0;
        while(money < 5000){
            year += 1;
            money *= 1.05;
        }
        alert(year);
    </script>
</head>
<body>
    
</body>
</html>